﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/List.Master"  AutoEventWireup="true" CodeBehind="Bu_DocReceive_Temp_List.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Audit.Bu_DocReceive_Temp_List"  %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script language="javascript" type="text/javascript">
        function doToDatabaseProject(id, UserID) {
            openDialog('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Module/Project/Project_Edit.aspx?IsToDatabase=1&ID=' + id + '&UserID=' + UserID + '&FunctionID=<%=Request["FunctionID"] %>', 720, 600, '项目信息入库');
        }
        function doToDatabaseContract(id, UserID) {
            openDialog('<%=Honestysoft.Baseframework.WebUI.Globals.Home %>Module/Contract/ContractEdit_ToDatabase.aspx?IsToDatabase=1&ID=' + id + '&UserID=' + UserID + '&FunctionID=<%=Request["FunctionID"] %>', 720, 600, '合同信息入库');
        }
        function doToDatabase(id,UserID) {
            $.ajax({
                type: "POST",
                url: 'ToDatabase.ashx?ID=' + id + '&UserID=' + UserID + '&randID=' + escape(new Date()),
                success: function (msg) {
                    if (msg != "0") {
                        alert('入库成功！请到项目/合同库中修改项目/合同的相关信息！');
                        window.location.href = window.location.href;
                    }
                    else {
                        alert('入库失败！服务器连接出错,无法获取数据！');
                    }
                },
                error: function () { unlocking(); alert('服务器出错,无法获取数据！'); }
            });
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">		
    <div class="query_area">
		项目名称：<asp:TextBox ID="txtProjectName" runat="server"  cssClass="input2" MaxLength="200" Width="180px"></asp:TextBox>&nbsp;&nbsp;
		合同名称：<asp:TextBox ID="txtContractName" runat="server"  cssClass="input2" MaxLength="200" Width="180px"></asp:TextBox>&nbsp;&nbsp;
		
        <asp:Button runat="server" ID="btnQuery" Text="查 找" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" OnClick="btnQuery_Click" />
    </div>            
    <div class="button_area">
        <asp:Button runat="server" ID="btnProjAdd" CssClass="btn_big_normal" 
			onMouseOver="this.className='btn_big_active'" 
            onMouseOut="this.className='btn_big_normal'" Text="项目首次申请"/>
        <asp:Button runat="server" ID="btnConAdd" CssClass="btn_big_normal" 
			onMouseOver="this.className='btn_big_active'" 
            onMouseOut="this.className='btn_big_normal'" Text="合同首次申请"/>
        <asp:Button runat="server" ID="btnDelete" CssClass="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" Text="删 除" 
            OnClientClick="javascript:return doListDelConfirm('chkID','chkAll');"             
            onclick="btnDelete_Click" />
    </div>
            
    <table cellpadding="0" width="100%" cellspacing="0" border="1" class="t1" id="tGrid">
		<thead>  
            <th align="center" width="30px">
                <input type="checkbox" name="chkAll" value="checkbox" onclick='javascript:checkAll(this,"chkID")' />
            </th>
            <th align="center" width="70px">编号</th>
            <th align="center" width="90px">类型</th>            
            <th align="center">项目名称</th>
            <th align="center" width="50px">项目是否入库</th>
            <th align="center">合同名称</th>
            <th align="center" width="50px">合同是否入库</th>
            <th align="center"  width="80px">本笔申请金额</th>
            <th align="center"  width="70px">接收时间</th>
            <th align="center"  width="50px">接收人</th>
            <th align="center" width="80px">操作</th>
      	</thead>           
		<asp:Repeater runat="server" ID="rptList">
			<ItemTemplate>
				<tr>
					<td align="center" >
						<input type="checkbox" name="chkID" id="chk<%# DataBinder.Eval(Container.DataItem,"ID") %>"  value="<%# DataBinder.Eval(Container.DataItem,"ID") %>" >
					</td>
					<td><%#  DataBinder.Eval(Container.DataItem,"Code") %></td>
					<td><%# GetNewType(Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsProjectFirst")))%></td>                    
                    <td style="text-align:left"><%#  DataBinder.Eval(Container.DataItem,"ProjectName") %></td>
                    <td><%# Honestysoft.Baseframework.WebUI.ScriptHelper.Image.GetBooleanImage(DataBinder.Eval(Container.DataItem,"IsToDBProj")) %></td>
                    <td style="text-align:left"><%#  DataBinder.Eval(Container.DataItem,"ContractName") %></td>
					<td><%# Honestysoft.Baseframework.WebUI.ScriptHelper.Image.GetBooleanImage(DataBinder.Eval(Container.DataItem,"IsToDBCon")) %></td>
                    <td style="text-align:right"><%# string.Format("{0:N}",  DataBinder.Eval(Container.DataItem,"Amount")) %></td>
                    <td ><%# string.Format("{0:yyyy-MM-dd}",  DataBinder.Eval(Container.DataItem,"ReceiveDate")) %></td>
                    <td ><%# DataBinder.Eval(Container.DataItem,"ToEmployeeName")%></td>
					<td>
						<%# GetButtonScript(DataBinder.Eval(Container.DataItem, "ID") + "", Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsProjectFirst")), Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsToDBProj")), Convert.ToBoolean(DataBinder.Eval(Container.DataItem, "IsToDBCon")))%>
					</td>
				</tr>  
			</ItemTemplate>
		</asp:Repeater>
        <tr>
            <td colspan="11" style="line-height: 28px;text-align:left;">
                <frameworkwebcontrols:aspnetpager id="AspNetPager1" runat="server"
                    alwaysshow="true" firstpagetext="首页" lastpagetext="尾页" nextpagetext="下一页" pageindexboxtype="DropDownList"
                    prevpagetext="上一页" showpageindex="true" showcustominfosection="Right" submitbuttontext="Go"
                    textafterpageindexbox="页" textbeforepageindexbox="转到" currentpagebuttonposition="End"
                    layouttype="Div" custominfotextalign="Right" custominfohtml="共%RecordCount%条记录。第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条"
                    direction="LeftToRight" onpagechanged="AspNetPager1_PageChanged">
                </frameworkwebcontrols:aspnetpager>            
            </td>
        </tr>
    </table>
</asp:Content>